#include <stdio.h>
#include <math.h>
//打印1到100000的水仙花数
void function()
{
    for (int i = 0; i < 100000; i++)
    {
        int count = 0;
        int temp = i;
        //先判断几位数
        while (temp != 0)
        {
            
            count ++;
            temp /= 10;
        }
        temp = i;
        int sum = 0;
        while (temp != 0)
        {
            sum += pow(temp % 10, count);//t的c次方
            temp /= 10;
        }
        if (sum == i)
        {
            printf("%d ", i);
        }
    }

}
int main()
{
    function();
    return 0;
}